import { defineComponent as N, openBlock as _, createElementBlock as y, createElementVNode as v, normalizeClass as w, normalizeStyle as I, renderSlot as E, createTextVNode as P, toDisplayString as x, ref as p, reactive as D, createVNode as F, TransitionGroup as R, withCtx as G, Fragment as W, renderList as q, createCommentVNode as L, createApp as U, resolveComponent as j, Transition as J, pushScopeId as K, popScopeId as Q, onMounted as X, watch as Y } from "vue";
const Z = ["disabled"], V = { class: "u-text" }, ee = {
  //组件名称
  name: "ls-button"
}, te = /* @__PURE__ */ N({
  ...ee,
  props: {
    name: { default: "按钮" },
    type: { default: "default" },
    size: { default: "middle" },
    disabled: { type: Boolean, default: !1 },
    round: { type: Boolean, default: !1 },
    width: {},
    height: {},
    font: {},
    fontColor: {}
  },
  setup(l) {
    return (e, r) => (_(), y("div", null, [
      v("button", {
        class: w([
          "my-button",
          e.type,
          e.size,
          { buttonDisable: e.disabled },
          { buttonRound: e.round }
        ]),
        disabled: e.disabled,
        style: I({
          width: e.width + "px",
          height: e.height + "px",
          "font-size": e.font + "px",
          color: e.fontColor
        })
      }, [
        v("span", V, [
          E(e.$slots, "default", {}, () => [
            P(x(e.name), 1)
          ], !0)
        ])
      ], 14, Z)
    ]));
  }
}), H = (l, e) => {
  const r = l.__vccOpts || l;
  for (const [u, o] of e)
    r[u] = o;
  return r;
}, B = /* @__PURE__ */ H(te, [["__scopeId", "data-v-eefa1cf9"]]), oe = {
  class: "messageBox",
  style: {}
}, le = {
  key: 0,
  class: "message"
}, ne = { class: "text" }, ae = {
  //组件名称
  name: "ls-message"
}, se = /* @__PURE__ */ N({
  ...ae,
  setup(l, { expose: e }) {
    const r = p(!1);
    let u;
    ((i) => {
      i.info = "#1677FF", i.success = "#52c41a", i.error = "#ff4d4f", i.warn = "#faad14", i.loading = "#1677FF";
    })(u || (u = {}));
    const o = D({
      clickItem: [
        {
          type: "",
          content: "",
          duration: 3e3,
          top: "",
          width: "200",
          height: "200",
          fontSize: "10",
          fontColor: "",
          shake: !1
        }
      ]
    }), s = D({
      clickContentItem: []
    });
    function a(i, c, n, h, m, g, S, b, C) {
      const k = {
        type: i,
        content: c,
        duration: n,
        top: h,
        width: m,
        height: g,
        fontSize: S,
        fontColor: b,
        shake: C
      };
      console.log(k, "currentClick"), o.clickItem[0] = k, console.log(o.clickItem), s.clickContentItem.push(k), console.log(k, s.clickContentItem), t(k);
    }
    function d({
      type: i,
      content: c = "这是一条消息",
      duration: n = 3e3,
      top: h = 30,
      shake: m = !1,
      width: g = "170",
      height: S = "25",
      fontSize: b = "13",
      fontColor: C = ""
    }) {
      a(
        i,
        c,
        n,
        h,
        g,
        S,
        b,
        C,
        m
      );
    }
    function f({
      type: i,
      content: c = "这是一条消息",
      duration: n = 3e3,
      top: h = 30,
      shake: m = !1,
      width: g = "170",
      height: S = "25",
      fontSize: b = "13",
      fontColor: C = ""
    }) {
      a(
        i,
        c,
        n,
        h,
        g,
        S,
        b,
        C,
        m
      );
    }
    function z({
      type: i,
      content: c = "这是一条消息",
      duration: n = 3e3,
      top: h = 30,
      shake: m = !1,
      width: g = "170",
      height: S = "25",
      fontSize: b = "13",
      fontColor: C = ""
    }) {
      a(
        i,
        c,
        n,
        h,
        g,
        S,
        b,
        C,
        m
      );
    }
    function $({
      type: i,
      content: c = "这是一条消息",
      duration: n = 3e3,
      top: h = 30,
      shake: m = !1,
      width: g = "170",
      height: S = "25",
      fontSize: b = "13",
      fontColor: C = ""
    }) {
      a(
        i,
        c,
        n,
        h,
        g,
        S,
        b,
        C,
        m
      );
    }
    const t = (i) => {
      r.value = !0;
      const c = setInterval(() => {
        for (let n = 0; n < s.clickContentItem.length; n++)
          if (s.clickContentItem[n].duration === i.duration) {
            s.clickContentItem.splice(n, 1);
            break;
          }
        console.log(6666), clearInterval(c);
      }, i.duration);
    };
    return e({
      info: d,
      success: f,
      warn: z,
      error: $
    }), (i, c) => (_(), y("div", oe, [
      s.clickContentItem.length != 0 ? (_(), y("div", le, [
        F(R, { name: "slide-fade" }, {
          default: G(() => [
            (_(!0), y(W, null, q(s.clickContentItem, (n, h) => (_(), y("div", {
              class: w(["messageContent", { shake: n.shake }]),
              style: I({
                top: n.top + "px",
                width: n.width + "px",
                height: n.height + "px",
                lineHeight: n.height + "px",
                fontSize: n.fontSize + "px",
                color: n.fontColor
              }),
              key: h
            }, [
              v("i", {
                class: w(["iconfont", `icon-${n.type}`]),
                style: I({
                  color: u[n.type],
                  fontSize: (n == null ? void 0 : n.fontSize) * 1.8 + "px"
                })
              }, null, 6),
              v("span", ne, x(n.content), 1)
            ], 6))), 128))
          ]),
          _: 1
        })
      ])) : L("", !0)
    ]));
  }
}), ie = /* @__PURE__ */ H(se, [["__scopeId", "data-v-046e744f"]]), re = function() {
  const l = document.createElement("div");
  return l.id = "ls-message", document.body.appendChild(l), U(ie).mount("#ls-message");
}, O = re(), ue = (l) => (K("data-v-dfefc4df"), l = l(), Q(), l), ce = {
  key: 0,
  class: "dialog"
}, de = /* @__PURE__ */ ue(() => /* @__PURE__ */ v("div", { class: "m-dialog-mask" }, null, -1)), fe = { class: "dialogBox" }, he = { class: "dialogContent" }, pe = {
  //组件名称
  name: "ls-dialog"
}, ve = /* @__PURE__ */ N({
  ...pe,
  props: {
    isShowMask: { type: Boolean, default: !1 }
  },
  emits: ["closeDialog"],
  setup(l, { emit: e }) {
    const r = l, u = e, o = () => {
      u("closeDialog");
    };
    return (s, a) => {
      const d = j("ls-button");
      return r.isShowMask ? (_(), y("div", ce, [
        F(J, { name: "mask" }, {
          default: G(() => [
            de
          ]),
          _: 1
        }),
        v("div", fe, [
          v("div", he, [
            F(d, {
              type: "primary",
              onClick: o
            })
          ])
        ])
      ])) : L("", !0);
    };
  }
}), T = /* @__PURE__ */ H(ve, [["__scopeId", "data-v-dfefc4df"]]), me = {
  //组件名称
  name: "ls-accordion"
}, ge = /* @__PURE__ */ N({
  ...me,
  props: {
    width: { default: "1200" },
    height: { default: "350" },
    imgSpace: { default: "200" },
    hoverSpace: { default: "300" },
    fontSize: { default: "16" },
    fontColor: { default: "#fff" },
    hoverFontColor: { default: "#67c23a" },
    hoverFontSize: { default: "20" },
    titleHeight: { default: "100" },
    hoverTitleHeight: { default: "150" },
    showTitle: { type: Boolean, default: !1 },
    titleCenter: { type: Boolean, default: !1 }
  },
  setup(l) {
    const e = l, r = p(), u = p(0), o = p(0), s = p(), a = p(), d = p(0), f = p(0), z = () => {
      const t = r.value ? r.value.querySelectorAll("li") : [];
      console.log(`Number of <li> nodes: ${t.length}`), o.value = t.length, a.value = Number(e.width) * 0.3, (o.value - 1) * Number(e.imgSpace) + a.value > e.width ? u.value = (Number(e.width) - a.value) / (o.value - 1) : u.value = 0, e.width > a.value + Number(e.imgSpace) * (o.value - 1) ? d.value = a.value + Number(e.imgSpace) * (o.value - 1) : d.value = 0, console.log(a.value + Number(e.imgSpace) * (o.value - 1)), console.log(
        Number(e.hoverSpace) + Number(e.imgSpace) * (o.value - 1),
        a.value + Number(e.imgSpace) * (o.value - 1),
        Number(e.width) - Number(e.imgSpace) * (o.value - 1),
        Number(e.imgSpace) * (o.value - 1),
        e.width
      ), Number(e.hoverSpace) + Number(e.imgSpace) * (o.value - 1) > a.value + Number(e.imgSpace) * (o.value - 1) ? f.value = 1160 - Number(e.imgSpace) * (o.value - 1) : f.value = 0;
    }, $ = () => {
      const t = new MutationObserver((i) => {
        var c;
        for (const n of i)
          n.type === "childList" && (o.value = (c = r.value) == null ? void 0 : c.querySelectorAll("li").length);
      });
      return t.observe(r.value, { childList: !0 }), () => t.disconnect();
    };
    return X(() => {
      z(), $();
    }), Y(
      () => [e.imgSpace, e.width, o.value, e.hoverSpace],
      (t, i) => {
        a.value = t[1] * 0.3, t[0] * (o.value - 1) + a.value > t[1] ? u.value = (t[1] - a.value) / (o.value - 1) : u.value = 0, t[1] > a.value + t[0] * (o.value - 1) ? d.value = a.value + t[0] * (o.value - 1) : d.value = 0, Number(t[3]) + t[0] * (o.value - 1) > a.value + t[0] * (o.value - 1) ? (f.value = 1160 - t[0] * (o.value - 1), console.log("da", f.value), console.log(
          f.value == 0 ? t[3] + "px" : f.value + "px"
        )) : f.value = 0;
      }
    ), (t, i) => (_(), y("div", {
      class: "accordion",
      style: I({
        width: d.value == 0 ? t.width + "px" : d.value + "px",
        height: t.height + "px",
        lineHeight: t.titleCenter ? t.titleHeight + "px" : "",
        "--imgWidth": s.value + "px",
        "--lastImg": a.value + "px",
        "--imgSpace": u.value == 0 ? t.imgSpace + "px" : u.value + "px",
        "--hoverSpace": f.value == 0 ? t.hoverSpace + "px" : f.value + "px",
        "--AllFontSize": t.fontSize + "px",
        "--AllFontColor": t.fontColor,
        "--AllHoverFontColor": t.hoverFontColor,
        "--AllHoverFontSize": t.hoverFontSize + "px",
        "--AllHoverTitleHeight": t.hoverTitleHeight + "px",
        "--titleHeight": t.titleHeight + "px",
        "--showTitle": t.showTitle ? "block" : "none",
        "--isHoverTitleHeight": t.titleCenter ? t.hoverTitleHeight + "px" : t.titleHeight + "px"
      })
    }, [
      v("ul", {
        ref_key: "ulRef",
        ref: r
      }, [
        E(t.$slots, "default", {}, void 0, !0)
      ], 512)
    ], 4));
  }
}), A = /* @__PURE__ */ H(ge, [["__scopeId", "data-v-8c9118ab"]]), Se = { class: "accordion-item" }, be = ["src"], Ce = {
  //组件名称
  name: "ls-accordion-item"
}, _e = /* @__PURE__ */ N({
  ...Ce,
  props: {
    src: { default: "" },
    title: { default: "" },
    link: {},
    fontSize: { default: "" },
    fontColor: { default: "" },
    hoverBGColor: { default: "" },
    hoverHeight: { default: "" },
    height: { default: "100" },
    hoverFontSize: { default: "" },
    hoverFontColor: { default: "" },
    notShowTitle: { type: Boolean, default: !1 },
    titleCenter: { type: Boolean, default: !1 }
  },
  setup(l) {
    const e = l, r = p(!1), u = p({}), o = (s) => {
      r.value = s, r.value ? u.value = {
        background: e.hoverBGColor == "" ? "" : e.hoverBGColor,
        color: e.hoverFontColor == "" ? "" : e.hoverFontColor,
        fontSize: e.hoverFontSize == "" ? "" : e.hoverFontSize + "px",
        height: e.hoverHeight == "" ? "" : e.hoverHeight + "px",
        lineHeight: e.titleCenter ? e.hoverHeight + "px" : ""
      } : u.value = {};
    };
    return (s, a) => (_(), y("li", Se, [
      v("img", {
        src: s.src,
        alt: ""
      }, null, 8, be),
      v("p", {
        style: I({
          fontSize: s.fontSize == "" ? "" : s.fontSize + "px",
          color: s.fontColor == "" ? "" : s.fontColor,
          height: s.height == "" ? "" : s.height + "px",
          display: s.notShowTitle ? "none" : "block",
          lineHeight: s.titleCenter ? s.height + "px" : "",
          ...u.value
        }),
        onMouseover: a[0] || (a[0] = (d) => o(!0)),
        onMouseout: a[1] || (a[1] = (d) => o(!1))
      }, x(s.title), 37)
    ]));
  }
}), M = /* @__PURE__ */ H(_e, [["__scopeId", "data-v-9426d1b6"]]), ye = [B, T, A, M], ke = {};
ke.install = function(l, e) {
  l.config.globalProperties.$message = O, ye.forEach((r) => {
    l.component(r.name, r);
  });
};
const Ie = {}, Ne = {}, He = {}, ze = {}, $e = {};
Ie.install = (l) => l.component(B.name, B);
Ne.install = (l) => {
  l.config.globalProperties.$message = O;
};
He.install = (l) => l.component(T.name, T);
ze.install = (l) => l.component(A.name, A);
$e.install = (l) => l.component(M.name, M);
export {
  ke as default,
  ze as myAccordion,
  $e as myAccordionItem,
  Ie as myButton,
  He as myDialog,
  Ne as myMessage
};
